<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="ALORK 20150428.01" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />

<title><?php echo $this->_var['page_title']; ?></title>

<link href="<?php echo $this->_var['ecs_css_my']; ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->_var['__PUC__']; ?>css/common.css" />

<?php echo $this->smarty_insert_scripts(array('files'=>'common.js,user.js')); ?>
</head>
<body>
<?php echo $this->fetch('library/page_header.lbi'); ?>
<a href="user.php" id="user_top"><div class="title"></div></a>
<div class="width100">
<div id="user" class="body">
  
  <div id="left" class="left">
    <div class="box box_1">

        <?php echo $this->fetch('library/user_menu.lbi'); ?>
    </div>
  </div>
  

  
  <div class="right" id="right" >
         
         <?php if ($this->_var['action'] == 'profile'): ?>
        <div id="title_list"> <span class="title ">// 用户资料 //</span></div>
         <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js,date.js')); ?>
        <script type="text/javascript">
          <?php $_from = $this->_var['lang']['profile_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
            var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </script>
 
     <form name="formEdit" action="user.php" method="post" onSubmit="return userEdit()">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="user_profile">
        <tr>
          <td align="right" width="100">当前头像：</td>
          <td>
            <div class="head">
            <a href="user.php?act=profile&type=head">修改头像</a>
            <?php if ($this->_var['info']['head']): ?>
            <img src="<?php echo $this->_var['info']['head']; ?>" alt="" width="67px;" height="67px;">
            <?php else: ?>
            <img src="<?php if ($this->_var['info']['sex'] == 1): ?>img/sex0.jpg<?php else: ?>img/sex1.jpg<?php endif; ?>" alt="" width="67px;" height="67px;">
            <?php endif; ?>
            </div>
          </td>
        </tr>
        <tr>
          <td align="right">手机：</td>
          <td align="left" bgcolor="#FFFFFF"><input name="mobile_phone" type="text" value="<?php echo $this->_var['profile']['mobile_phone']; ?>" size="25" class="input_border" /></td>
        </tr>
        <tr>
          <td align="right">E-mail：</td>
          <td align="left" bgcolor="#FFFFFF"><?php echo $this->_var['profile']['email']; ?>　<?php if (! $this->_var['profile']['is_validated']): ?><a href="javascript:sendHashMail();" class="button_1" style="width: 80px;height: 25px;display: inline-table;line-height: 25px;">进行验证</a><?php else: ?><span>已验证</span><?php endif; ?></td>
        </tr>
        <tr>
          <td align="right">真实姓名：</td>
          <td align="left" bgcolor="#FFFFFF"><input name="real_name" type="text" value="<?php echo $this->_var['profile']['real_name']; ?>" size="25" class="input_border" /></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#FFFFFF">性别： </td>
          <td align="left" bgcolor="#FFFFFF"><input type="radio" name="sex" value="0" <?php if ($this->_var['profile']['sex'] == 0): ?>checked="checked"<?php endif; ?> />
            <?php echo $this->_var['lang']['secrecy']; ?>&nbsp;&nbsp;
            <input type="radio" name="sex" value="1" <?php if ($this->_var['profile']['sex'] == 1): ?>checked="checked"<?php endif; ?> />
            <?php echo $this->_var['lang']['male']; ?>&nbsp;&nbsp;
            <input type="radio" name="sex" value="2" <?php if ($this->_var['profile']['sex'] == 2): ?>checked="checked"<?php endif; ?> />
          <?php echo $this->_var['lang']['female']; ?>&nbsp;&nbsp; </td>
        </tr>
        <tr>
          <td align="right" bgcolor="#FFFFFF">生日： </td>
          <td align="left" bgcolor="#FFFFFF">
            <script type="text/javascript">
            $(".head").mouseenter(function(){
              $(this).find("a").show();
            });
            $(".head").mouseleave(function(){
              $(this).find("a").hide();
            });
            $(function(){
              date(<?php echo $this->_var['profile']['year']; ?>,<?php echo $this->_var['profile']['month']; ?>,<?php echo $this->_var['profile']['day']; ?>);
            });
            </script>
          <span class="select_ui">
            <div class="select_arrow"></div>
            <div class="select_text_ui" style="min-width: 2.5em;"><?php echo $this->_var['profile']['year']; ?>年</div>
            <select id="year" name="birthdayYear" required="true" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());">
            </select>
          </span>
          <span class="select_ui">
            <div class="select_arrow"></div>
            <div class="select_text_ui" style="min-width: 2.5em;"><?php echo $this->_var['profile']['month']; ?>月</div>
            <select id="month" name="birthdayMonth" required="true" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());">
              
            </select>
          </span>
          <span class="select_ui">
            <div class="select_arrow"></div>
            <div class="select_text_ui" style="min-width: 2.5em;"><?php echo $this->_var['profile']['day']; ?>日</div>
            <select id="day" name="birthdayDay" required="true" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());">
            </select>
          </span>
          </td>
        </tr>
        <tr>
          <td align="right">画龄：</td>
          <td align="left" bgcolor="#FFFFFF">
            <input name="picture_age" type="text" value="<?php echo $this->_var['profile']['picture_age']; ?>" size="25" class="input_border" />
          </td>
        </tr>
        <tr>
          <td align="right" bgcolor="#FFFFFF">QQ：</td>
          <td align="left" bgcolor="#FFFFFF">
          <input name="qq" type="text" class="input_border isnumber" value="<?php echo $this->_var['profile']['qq']; ?>" size="25">
          </td>
        </tr>
        <tr>
          <td align="right">学校名称：</td>
          <td align="left" bgcolor="#FFFFFF"><input name="school_name" type="text" value="<?php echo $this->_var['profile']['school_name']; ?>" size="25" class="input_border" /></td>
        </tr>
        <tr>
          <td align="right">集训地区：</td>
          <td align="left" bgcolor="#FFFFFF"><input name="camp" type="text" value="<?php echo $this->_var['profile']['camp']; ?>" size="25" class="input_border" /></td>
        </tr>
        <tr>
          <td align="right">画室名称：</td>
          <td align="left" bgcolor="#FFFFFF">
            <input name="studio" type="text" value="<?php echo $this->_var['profile']['studio']; ?>" size="25" class="input_border" />
          </td>
        </tr>
        <tr>
          <td align="right">个性签名：</td>
          <td><textarea class="input_border" name="signature" value="<?php echo $this->_var['profile']['signature']; ?>" style="overflow: hidden; width: 482px; height: 98px; resize: none;"><?php echo $this->_var['profile']['signature']; ?></textarea></td>
        </tr>
        <tr>
          <td align="right">兴趣爱好：</td>
          <td><textarea class="input_border" name="hobby" value="<?php echo $this->_var['profile']['hobby']; ?>" style="overflow: hidden; width: 482px; height: 98px; margin-top: 25px; resize: none;"><?php echo $this->_var['profile']['hobby']; ?></textarea></td>
        </tr>
        <tr>
          <td></td>
          <td colspan="1" align="left" bgcolor="#FFFFFF"><input name="act" type="hidden" value="act_edit_profile" />
            <input name="submit" type="submit" value="更改" class="button_1" />
          </td>
        </tr>
      </table>
    <?php endif; ?>
    

    
         <?php if ($this->_var['action'] == 'profile_pass'): ?>
        <div id="title_list"> <span class="title ">用户密码修改</span></div>
         <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js')); ?>
        <script type="text/javascript">
          <?php $_from = $this->_var['lang']['profile_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
            var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </script>
    </form>
     <form name="formPassword" action="user.php" method="post" onSubmit="return editPassword()" >
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="user_pass" >
        <tr>
          <td width="12%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['old_password']; ?>：</td>
          <td width="76%" align="left" bgcolor="#FFFFFF"><input name="old_password" type="password" size="25"  class="input_border" /></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['new_password']; ?>：</td>
          <td align="left" bgcolor="#FFFFFF"><input name="new_password" type="password" size="25"  class="input_border" /></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['confirm_password']; ?>：</td>
          <td align="left" bgcolor="#FFFFFF"><input name="comfirm_password" type="password" size="25"  class="input_border" /></td>
        </tr>
        <tr>
          <td></td>
          <td colspan="1" align="left" bgcolor="#FFFFFF"><input name="act" type="hidden" value="act_edit_password" />
            <input name="submit" type="submit" class="button_1" value="更改" />
          </td>
        </tr>
      </table>
    </form>
    <div>
      <table>
         <tr style="height: 42px;">
         </tr>
      </table>
    </div>
    <?php endif; ?>
    

      
       <?php if ($this->_var['action'] == 'order_list'): ?>
        <div id="title_list"> <span class="title ">// 我的订单 //</span></div>
          <table width="818px" border="0" cellpadding="0" cellspacing="0"  class="order_msg" >
          <tr class="list">
            <th width="2%"></th>
            <th width="13%">商品</th>
            <th width="18%">订单号</th>
            <th width="16%">下单时间</th>
            <th width="20%">总价</th>
            <th width="15%">订单状态</th> 
            <th width="14%">操作</th>
            <th width="2%"></th>
          </tr>
          <?php $_from = $this->_var['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
          <tr class="goods" align="center">
            <td></td>
            <td class="sum1" width="13%" valign='center'>
              <a href="user.php?act=order_detail&order_id=<?php echo $this->_var['item']['order_id']; ?>" class="f6"><img src="<?php echo $this->_var['item']['son']['0']['goods_thumb']; ?>" alt="" width="95px;" height="95px;"/></a>
             <div>共<?php echo $this->_var['item']['son']['0']['count']; ?>件</div>
            </td>
            <td class="border" width="18%" valign='center'><?php echo $this->_var['item']['order_sn']; ?></td>
            <td class="border" width="13%" valign='center'><?php echo $this->_var['item']['order_time']; ?></td>
            <td class="border" width="20%" valign='center'><span style="color: #9f1212"><?php echo $this->_var['item']['total_fee']; ?>(含运费<?php echo $this->_var['item']['shipping_fee']; ?>)</span></td>
            <td class="border" width="15%" valign='center'><?php echo $this->_var['item']['order_status']; ?><br /></td>
            <td class="border" width="14%" valign='center'>
              <?php if ($this->_var['item']['pay_online']): ?><?php echo $this->_var['item']['pay_online']; ?><?php endif; ?>
              <?php if ($this->_var['item']['comment']): ?><?php echo $this->_var['item']['comment']; ?><br /><?php endif; ?>
              <?php if ($this->_var['item']['comment_more']): ?><?php echo $this->_var['item']['comment_more']; ?> <br /><?php endif; ?>
              <?php if ($this->_var['item']['handler']): ?><?php echo $this->_var['item']['handler']; ?><br /><?php endif; ?>
              <a href="user.php?act=order_detail&order_id=<?php echo $this->_var['item']['order_id']; ?>">查看订单</a><br />
              <a onclick="return_to_cart(<?php echo $this->_var['item']['order_id']; ?>)">放回购物车</a><br />
              <?php if ($this->_var['item']['link']): ?><?php echo $this->_var['item']['link']; ?><br/><?php endif; ?>

              <?php if ($this->_var['item']['sale']): ?><?php echo $this->_var['item']['sale']; ?><?php endif; ?>
            </td>
            <td>
            <?php if ($this->_var['num_4_1'] == 1 && $this->_var['item']['pay_time'] >= 1427860800): ?>
            <div class="pic"><a href="http://pan.baidu.com/share/init?shareid=1898491918&uk=89062392">名家高清画作领取</a>提取码：2w46  </div>
            <?php endif; ?>
            </td>
          </tr>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
          </table>
          <script type="text/javascript">
          /**
           * 订单商品加回购物车
          */
          function return_to_cart(order_id){
            var url="user.php?act=return_to_cart&r="+Math.random();
            htmlobj=$.post(url, {'order_id' : order_id}, function(data){
              return_to_cart_return(data);
            },'JSON');

          }
          function return_to_cart_return(data){
            alert(data.message);
          }
          </script>
        <?php echo $this->fetch('library/pages_user.lbi'); ?>
        <?php if ($this->_var['info']['freeplan_info']): ?>
        <div class="famous_paintings">
            <div class="content">
                <a href="http://pan.baidu.com/share/init?shareid=1898491918&uk=89062392" target="_blank" title="">名家高清画作领取</a>
                <span>提取码：2w46</span>
            </div>
        </div>
        <?php endif; ?>
      <?php endif; ?>
      

      
      <?php if ($this->_var['action'] == 'guadanle'): ?>
        <?php echo $this->smarty_insert_scripts(array('files'=>'transport.js,utils.js')); ?>
        <div id="title_list"> <span class="title ">// 我的刮蛋乐 //</span></div>
        <div class="buy_goods">
          <input type="text" class="exchange_border" id="cdkey" placeholder="输入刮蛋乐兑奖号" />
          <a class="button1" <?php if ($_SESSION['user_id']): ?> onclick="exchange();"<?php else: ?> onclick="$('#is_login,.is_login_bg').show();"<?php endif; ?> class="exchange">兑换</a>
        </div>
        <div class="captcha_box<?php if ($_SESSION['error'] < 3): ?> none<?php endif; ?>">
          <input type="text" size="8" name="captcha" id="captcha" class="code" onfocus="this.value=''" placeholder="输入验证码" /><img class="captcha" src="captcha.php?rand=<?php echo $this->_var['rand']; ?>" alt="captcha" style="vertical-align: middle;cursor: pointer;" onclick="this.src='captcha.php?rand='+Math.random()" id="fail_img"/>
      </div>
        <script type="text/javascript">
          // 兑奖AJAX
          function exchange(){
              var url="flow.php?step=exchange&is_no_add=1&r="+Math.random();
              var cdkey = $('#cdkey').val();
              if(cdkey){
                htmlobj=$.post(url, {'cdkey' : cdkey,'captcha' : $('#captcha').val(), 'provenance' : 3}, function(data){
                  exchange_return(data);
                },'JSON');
              }
          }
          function exchange_return(data){
            $('.captcha').attr('src','captcha.php?rand='+Math.random());
            if(data.error==1){
              Ctt('兑换成功',"location.href='user.php?act=guadanle';");
            }else if(data.error == 2){
              Ctt('兑换失败','return false;');
              $('.captcha_box').show();
            }else if(data.error == 3){
              Ctt('验证码错误','return false;');
              $('.captcha_box').show();
            }
            else{
              Ctt('兑换失败','return false;');
            }
          }
          function guadanle_add_cart(id){
              var url="flow.php?step=guadanle_add_cart&r="+Math.random();
              htmlobj=$.post(url, {'id' : id}, function(data){
                if(data.error == 1){
                  Ctt('操作出错！','return false;');
                }else{
                  Ctt('已加入购物车',"location.href='user.php?act=guadanle';");
                }
              },'JSON');
          }
        </script>
        <table width="818px" border="0" cellpadding="0" cellspacing="0"  class="order_msg" >
          <tr class="list">
            <th width="2%"></th>
            <th width="20%">兑奖号</th>
            <th width="20%">过期时间</th>
            <th width="18%">奖品</th>
            <th width="20%">订单状态</th>
            <th width="18%">操作</th>
            <th width="2%"></th>
          </tr>
          <?php $_from = $this->_var['exchange']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
          <tr class="donation" align="center">
            <td></td>
            <td class="border" width="20%" valign='center'><?php echo $this->_var['item']['cdkey']; ?></td>
            <td class="border" width="20%" valign='center' style="color: #9f1212">2015年1月1日</td>
            <td class="border" width="18%" valign='center'><a href="goods.php?id=<?php echo $this->_var['item']['goods_id']; ?>" target="_blank"><img src="<?php echo $this->_var['item']['goods_thumb']; ?>" alt="" width="92px;" height="92px;"/></a></td>
            <td class="border" width="20%" valign='center'>
              <?php if ($this->_var['item']['end_time'] < $this->_var['time'] && $this->_var['item']['exchange'] != 2): ?>已过期
              <?php elseif ($this->_var['item']['end_time'] >= $this->_var['time'] && $this->_var['item']['exchange'] == 1): ?>已加入购物车<br />
              <?php elseif ($this->_var['item']['exchange'] == 2): ?>已兑换<br />
              <?php elseif ($this->_var['item']['end_time'] >= $this->_var['time'] && $this->_var['item']['exchange'] == 3): ?>可加入购物车<br />
              <?php endif; ?>
            </td>
            <td class="border" width="18%" valign='center'>
              <?php if ($this->_var['item']['end_time'] >= $this->_var['time'] && $this->_var['item']['exchange'] == 3): ?>
                <a class="f6" <?php if ($_SESSION['user_id']): ?> onclick="guadanle_add_cart('<?php echo $this->_var['item']['id']; ?>');"<?php else: ?> onclick="$('#is_login,.is_login_bg').show();"<?php endif; ?> class="exchange">加入购物车</a>
              <?php endif; ?>
            </td>
            <td></td>
          </tr>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
          </table>
       <?php echo $this->fetch('library/pages_user.lbi'); ?>
    <?php endif; ?>
    

       
      <?php if ($this->_var['action'] == 'track_packages'): ?>
        <div id="title_list"> <span class="title ">// 我的包裹 //</span></div>
        <table width="818px" border="0" cellpadding="0" cellspacing="0"  class="order_table track_packages" >
        <tr class="list" align="center">
          <th><?php echo $this->_var['lang']['order_number']; ?></th>
          <th>快递单号</th>
          <th><?php echo $this->_var['lang']['handle']; ?></th>
        </tr>
        <?php $_from = $this->_var['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['item']):
?>
        <tr class="list">
          <td align="center"><a href="user.php?act=order_detail&order_id=<?php echo $this->_var['item']['order_id']; ?>"><?php echo $this->_var['item']['order_sn']; ?></a></td>
          <td align="center"><?php echo $this->_var['item']['invoice_no']; ?></td>
          <td align="center"><?php echo $this->_var['item']['query_link']; ?></td>
        </tr>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        <?php if (! $this->_var['orders']): ?>
        <tr class="list">
          <td colspan='3' align="center">您现在还没有任何包裹在路上</td>
        </tr>
        <?php endif; ?>
      </table>
      <script>
      var query_status = '<?php echo $this->_var['lang']['query_status']; ?>';
      var ot = document.getElementById('order_table');
      for (var i = 1; i < ot.rows.length; i++)
      {
        var row = ot.rows[i];
        var cel = row.cells[1];
        cel.getElementsByTagName('a').item(0).innerHTML = query_status;
      }
      </script>
      <?php endif; ?>
    

  
  <?php if ($this->_var['action'] == coupon): ?>
  <div id="title_list">
    <span class="title" onclick="delete_explain();" style='cursor: pointer'>// 我的优惠券 //</span>
    <span class="explain" onclick="open_explain();">使用说明></span>
  </div>
  <div id="coupon">
    <div class="coupon-top">
      <li class='now' onclick="$('#coupon .content').addClass('none').eq(0).removeClass('none');$(this).addClass('now').siblings().removeClass('now');">未使用(<?php echo empty($this->_var['couponIsUseCount']) ? 0 : $this->_var['couponIsUseCount']; ?>)</li>
      <li onclick="$('#coupon .content').addClass('none').eq(1).removeClass('none');$(this).addClass('now').siblings().removeClass('now');">已使用(<?php echo empty($this->_var['couponUseCount']) ? 0 : $this->_var['couponUseCount']; ?>)</li>
      <li onclick="$('#coupon .content').addClass('none').eq(2).removeClass('none');$(this).addClass('now').siblings().removeClass('now');">已过期(<?php echo empty($this->_var['couponOldCount']) ? 0 : $this->_var['couponOldCount']; ?>)</li>
    </div>
    
    <?php if (! empty ( $this->_var['couponIsUse'] ) || ! empty ( $this->_var['couponUse'] ) || ! empty ( $this->_var['couponOld'] )): ?>
    <div class="content ">
      <?php $_from = $this->_var['couponIsUse']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'coupon_son');if (count($_from)):
    foreach ($_from AS $this->_var['coupon_son']):
?>
      <?php if ($this->_var['coupon_son']['type_code'] == 'baoyou'): ?>
      <div class="box">
        <img src="../themes/default/pic/user_coupon_packet_mail.png" alt="包邮券">
        <h1><?php echo $this->_var['coupon_son']['coupon_name']; ?></h1>
        <p class="p1"><?php echo $this->_var['coupon_son']['coupon_note']; ?></p>
        <p class="p2">
        <br />
        有效期：<?php echo $this->_var['coupon_son']['start_time_format']; ?>至<?php echo $this->_var['coupon_son']['end_time_format']; ?>
        </p>
        <?php if ($this->_var['coupon_son']['is_due'] == 1): ?><p class="p3">即将到期</p><?php endif; ?>
      </div>
      <?php endif; ?>
      <?php if ($this->_var['coupon_son']['type_code'] == 'discount'): ?>
        <div class="box">
          <img src="../themes/default/pic/user_coupon_discount_coupon.png" alt="限期折扣券">
          <h1><?php echo $this->_var['coupon_son']['coupon_name']; ?></h1>
          <p class="p1"><?php echo $this->_var['coupon_son']['coupon_note']; ?></p>
          <p class="p2">
            <br>
            有效期：<?php echo $this->_var['coupon_son']['start_time_format']; ?>至<?php echo $this->_var['coupon_son']['end_time_format']; ?>
          </p>
           <?php if ($this->_var['coupon_son']['is_due'] == 1): ?><p class="p3 none">即将到期</p><?php endif; ?>
        </div>
      <?php endif; ?>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </div>

    
    <div class="content none">
      <?php $_from = $this->_var['couponUse']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'couponSon1');if (count($_from)):
    foreach ($_from AS $this->_var['couponSon1']):
?>
      <div class="content-list">
        <div class="left">
          <?php echo $this->_var['couponSon1']['coupon_name']; ?>
        </div>
        <div class="right">
          已使用
        </div>
      </div>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </div>

    <div class="content none">
      <?php $_from = $this->_var['couponOld']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'couponSon2');if (count($_from)):
    foreach ($_from AS $this->_var['couponSon2']):
?>
      <div class="content-list">
        <div class="left">
          <?php echo $this->_var['couponSon2']['coupon_name']; ?>
        </div>
        <div class="middle">
          有效期：<br />
          <?php echo $this->_var['couponSon2']['start_time_format']; ?>至<?php echo $this->_var['couponSon2']['end_time_format']; ?>
        </div>
        <div class="right">
          已过期
        </div>
      </div>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </div>






    <?php else: ?>
    <img src="../themes/default/pic/none_coupon.png" alt="" style="display: block;margin: 100px auto;" class="img"/>
    <?php endif; ?>


    
    <div class="coupon_explain none">
      <img src="../themes/default/pic/user_coupon_coupon_explain.jpg" alt="优惠券使用说明">
    </div>
  </div>
  <script type="text/javascript">
    /* 点击显示使用说明 */
    function open_explain(){
      $('#coupon .content,#title_list .explain,#coupon .img,.coupon-top').addClass('none');
      $('#coupon .coupon_explain').removeClass('none');
    }
    /* 点击显示使用说明 */
    function delete_explain(){
      $('#coupon .content').eq(0).removeClass('none');
      $('#title_list .explain,#coupon .img,.coupon-top').removeClass('none');
      $('#coupon .coupon_explain').addClass('none');
    }




  </script>
  <?php endif; ?>
  


     
      <?php if ($this->_var['action'] == order_detail): ?>
        <div id="title_list"><span class="title ">// 订单详情 //</span></div>
        <table width="818px" border="0" cellpadding="0" cellspacing="0"  id="status" >
            <tr>
              <?php if ($this->_var['order']['order_status'] == 0 && $this->_var['order']['shipping_status'] == 0): ?><td id="status1"/>
              <?php elseif ($this->_var['order']['order_status'] == 1 && $this->_var['order']['shipping_status'] == 0): ?><td id="status2"/>
              <?php elseif ($this->_var['order']['order_status'] == 1 && $this->_var['order']['shipping_status'] == 1): ?><td id="status3"/>
              <?php else: ?><td id="status4"/><?php endif; ?>
          </tr>
        </table>
        <div class="order_top">
          <table width="100%" border="0" cellpadding="0" cellspacing="0" >
            <tr>
            <td width="100%" align="center"><b>订单号 : <span><?php echo $this->_var['order']['order_sn']; ?></span>&nbsp;&nbsp;&nbsp; 状态 : 
              <?php if ($this->_var['order']['order_status'] == 0 && $this->_var['order']['shipping_status'] == 0): ?><span>开始受理</span>
              <?php elseif ($this->_var['order']['order_status'] == 1 && $this->_var['order']['shipping_status'] == 0): ?><span>正在配货</span>
              <?php elseif ($this->_var['order']['shipping_status'] == 1): ?><span>发货成功</span>
              <?php elseif ($this->_var['order']['order_status'] == 5 && $this->_var['order']['shipping_status'] == 2 && $this->_var['order']['pay_status'] = 2): ?><span>完成</span>
              <?php else: ?>
              <span>无效订单</span>
              <?php endif; ?></b></td>
            </tr>
          </table>
        </div>
        <?php if ($this->_var['order']['shipping_status'] == 1): ?>
        <div id="title_list2"><span class="title">订单跟踪</span></div> 
        <tr>
          <td>
            <a href="http://q.sto.cn/track.aspx?wen=<?php echo $this->_var['order']['invoice_no']; ?>" target="_blank">
            <input type="submit" name="submit" value="查看&#13;&#10;快递" class="button_5"/>
            </a>
          </td>
        </tr>  
        <?php endif; ?>   
        <div id="title_list2"><span class="title">订单信息</span></div>      
          <table width="100%" border="0" cellpadding="0" cellspacing="0"  class="order_addr">
            <tr class="list1" align="left">
              <td width="4%"></td>
              <td width="90%"><span style="font-size: 16px; font-weight: bold; color: #444444">收货人信息</span><br /><br /><br />收&nbsp;货&nbsp;人&nbsp;：<?php echo htmlspecialchars($this->_var['order']['consignee']); ?><br /><br />地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：<?php echo $this->_var['order']['addr']; ?><?php echo $this->_var['order']['area_name']; ?>　<?php echo $this->_var['order']['address']; ?><br /><br />手机号码：<?php echo htmlspecialchars($this->_var['order']['mobile']); ?></td>
              <td width="6%">
              </td>
            </tr>
            <tr class="list2" align="left">
              <td width="4%"></td>
              <td width="90%"><span style="font-size: 16px; font-weight: bold; color: #444444">支付方式</span><br /><br /><?php echo $this->_var['order']['pay_name']; ?></td>
            </tr>
          </table>

        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="order_price">
          <tr>
            <td align="right" bgcolor="#ffffff">
              商品总价<?php if ($this->_var['order']['extension_code'] == "group_buy"): ?><?php echo $this->_var['lang']['gb_deposit']; ?><?php endif; ?>：<span style="color: #9f1212;" class="font16"><?php echo $this->_var['order']['formated_goods_amount']; ?></span><br />

              <?php if ($this->_var['order']['discount'] > 0): ?>
              - <?php echo $this->_var['lang']['discount']; ?>: <?php echo $this->_var['order']['formated_discount']; ?>
              <?php endif; ?>
              <?php if ($this->_var['order']['shipping_fee'] > 0): ?>
              +运费：<span style="color: #9f1212;" class="font16"><?php echo $this->_var['order']['formated_shipping_fee']; ?></span>
              <?php endif; ?>
              <?php if ($this->_var['order']['pay_fee'] > 0): ?>
              + <?php echo $this->_var['lang']['pay_fee']; ?>: <?php echo $this->_var['order']['formated_pay_fee']; ?>
              <?php endif; ?>
              <?php if ($this->_var['order']['pack_fee'] > 0): ?>
              + <?php echo $this->_var['lang']['pack_fee']; ?>: <?php echo $this->_var['order']['formated_pack_fee']; ?>
              <?php endif; ?>
              <?php if ($this->_var['order']['card_fee'] > 0): ?>
              + <?php echo $this->_var['lang']['card_fee']; ?>: <?php echo $this->_var['order']['formated_card_fee']; ?>
              <?php endif; ?>        <br />
              <span><?php echo $this->_var['lang']['order_amount']; ?>: </span><span style="font-size: 28px; color: #9f1212;"><?php echo $this->_var['order']['formated_order_amount']; ?></span>
            </td>
               
              <td width='1%'></td>
              <td width="8%" colspan="3" align="center">
              <?php if ($this->_var['order']['pay_online']): ?><?php echo $this->_var['order']['pay_online']; ?><?php endif; ?></td>
          </tr>
          <tr>
            <td align="right" bgcolor="#ffffff">
              <?php if ($this->_var['order']['money_paid'] > 0): ?>
              - <?php echo $this->_var['lang']['order_money_paid']; ?>: <?php echo $this->_var['order']['formated_money_paid']; ?>
              <?php endif; ?>
              <?php if ($this->_var['order']['surplus'] > 0): ?>
              - <?php echo $this->_var['lang']['use_surplus']; ?>: <?php echo $this->_var['order']['formated_surplus']; ?>
              <?php endif; ?>
              <?php if ($this->_var['order']['integral_money'] > 0): ?>
              - <?php echo $this->_var['lang']['use_integral']; ?>: <?php echo $this->_var['order']['formated_integral_money']; ?>
              <?php endif; ?>
              <?php if ($this->_var['order']['bonus'] > 0): ?>
              - <?php echo $this->_var['lang']['use_bonus']; ?>: <?php echo $this->_var['order']['formated_bonus']; ?>
              <?php endif; ?>        
            </td>
          </tr>
        </table>
      <div id="title_list3"><span class="title">商品清单</span></div>
      <table width="818px" border="0" cellpadding="0" cellspacing="0"  class="order_msg2">
        <tr style="color: #444444;" class="list3">
          <td align="center" width="50%" colspan="2">商品</td>
          <td align="center" width="15%">价格</td>
          <td align="center" width="15%" colspan="3">数量</td>
          <td align="center" width="15%">操作</td>
          <td width="2%"></td>
        </tr>
        <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)):
    foreach ($_from AS $this->_var['goods']):
?>
        <tr height="160px;" class="order_goods">
          <td class="border" align="center" width="15%"><img src="<?php echo $this->_var['goods']['goods_thumb']; ?>" alt="<?php echo $this->_var['goods']['goods_name']; ?>" width="95px;" height="95px;" style="margin:0 auto;"/>
          </td>
          <?php if ($this->_var['goods']['goods_id'] == 0): ?>
          <td class="border font12" width="25%"><a href="activity.php?id=<?php echo $this->_var['goods']['parent_id']; ?>"><?php echo $this->_var['goods']['goods_name']; ?></a></td>
          <?php else: ?>
          <td class="border font12" width="25%"><a href="goods.php?id=<?php echo $this->_var['goods']['goods_id']; ?>"><a href="./goods.php?id=<?php echo $this->_var['goods']['goods_id']; ?>" class="f6"><?php if ($this->_var['goods']['is_gift'] == 1): ?><?php echo $this->_var['goods']['goods_name']; ?>(赠品)<?php else: ?><?php echo $this->_var['goods']['goods_name']; ?><?php endif; ?></a><br /><span class="c_9d9d9d font12"><?php echo $this->_var['goods']['goods_attr']; ?></span></a></td>
          <?php endif; ?>
          <td class="border c_c92655" align="center" style="color: #9f1212"><?php echo $this->_var['goods']['goods_price']; ?></td>
          <td class="border" align="center" colspan="3"  style="color: #9f1212;"><?php echo $this->_var['goods']['goods_number']; ?></td>
          <td class="border" width="15%" align="center" >
            <a href="user.php?act=comment_list" style="color: #9f1212;">我的评论</a>
            <?php if ($this->_var['item']['pay_online']): ?><?php echo $this->_var['item']['pay_online']; ?><?php endif; ?>
            <?php if ($this->_var['item']['comment']): ?><?php echo $this->_var['item']['comment']; ?><br /><?php endif; ?>
            <?php if ($this->_var['item']['comment_more']): ?><?php echo $this->_var['item']['comment_more']; ?> <br /><?php endif; ?>
            <?php if ($this->_var['item']['handler']): ?><?php echo $this->_var['item']['handler']; ?><br /><?php endif; ?>
          </td>
          <td width="2%"></td>
        </tr>
         <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        <tr>
          <td align="right" colspan="8" class="list_bottom c_c92655" >商品总价：<?php echo $this->_var['order']['formated_goods_amount']; ?></td>
        </tr>
      </table>
      <?php endif; ?>
    


    
      <?php if ($this->_var['action'] == "account_raply" || $this->_var['action'] == "account_log" || $this->_var['action'] == "account_deposit" || $this->_var['action'] == "account_detail"): ?>
        <script type="text/javascript">
          <?php $_from = $this->_var['lang']['account_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
            var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </script>
        <div id="title_list"> <span class="title ">会员余额 </span><span class="logo"></span></div>
         <table width="100%" border="0" cellpadding="0" cellspacing="0" class="account_top">
          <tr>
            <td align="right" height='40'><a href="user.php?act=account_deposit"><?php echo $this->_var['lang']['surplus_type_0']; ?></a><a href="user.php?act=account_raply"><?php echo $this->_var['lang']['surplus_type_1']; ?></a><a href="user.php?act=account_detail"><?php echo $this->_var['lang']['add_surplus_log']; ?></a><a href="user.php?act=account_log"><?php echo $this->_var['lang']['view_application']; ?></a></td>
          </tr>
        </table>
        <?php endif; ?>
        <?php if ($this->_var['action'] == "account_raply"): ?>
        <form name="formSurplus" method="post" action="user.php" onSubmit="return submitSurplus()">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="15%" bgcolor="#ffffff"><?php echo $this->_var['lang']['repay_money']; ?>:</td>
            <td bgcolor="#ffffff" align="left"><input type="text" name="amount" value="<?php echo htmlspecialchars($this->_var['order']['amount']); ?>" class="input_border" size="30" />
            </td>
          </tr>
          <tr>
            <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_notic']; ?>:</td>
            <td bgcolor="#ffffff" align="left"><textarea name="user_note" cols="55" rows="6" style="border:1px solid #ccc;resize: none;outline: none;"><?php echo htmlspecialchars($this->_var['order']['user_note']); ?></textarea></td>
          </tr>
          <tr>
            <td bgcolor="#ffffff" colspan="2" align="center">
            <input type="hidden" name="surplus_type" value="1" />
              <input type="hidden" name="act" value="act_account" />
              <input type="submit" name="submit"  class="button_1" value="提交" />
              <input type="reset" name="reset" class="button_1" value="重置" />
            </td>
          </tr>
        </table>
        </form>
        <?php endif; ?>
        <?php if ($this->_var['action'] == "account_deposit"): ?>
        <form name="formSurplus" method="post" action="user.php" onSubmit="return submitSurplus()">
        <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" style="color: #7e7878">
            <tr>
              <td width="15%" bgcolor="#ffffff"><?php echo $this->_var['lang']['deposit_money']; ?>:</td>
              <td align="left" bgcolor="#ffffff"><input type="text" name="amount"  class="new_input" value="<?php echo htmlspecialchars($this->_var['order']['amount']); ?>" size="30" /></td>
            </tr>
            <tr>
              <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_notic']; ?>:</td>
              <td align="left" bgcolor="#ffffff"><textarea name="user_note" cols="55" rows="6" style="border:1px solid #ccc;resize: none;outline: none;"><?php echo htmlspecialchars($this->_var['order']['user_note']); ?></textarea></td>
            </tr>
          </table>
          <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" style="color: #7e7878">
            <tr align="center">
              <td bgcolor="#ffffff"  colspan="3" align="left"><?php echo $this->_var['lang']['payment']; ?>:</td>
            </tr>
            <tr align="center">
              <td bgcolor="#ffffff"><?php echo $this->_var['lang']['pay_name']; ?></td>
              <td bgcolor="#ffffff" width="60%"><?php echo $this->_var['lang']['pay_desc']; ?></td>
              <td bgcolor="#ffffff" width="17%"><?php echo $this->_var['lang']['pay_fee']; ?></td>
            </tr>
            <?php $_from = $this->_var['payment']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
            <tr>
              <td bgcolor="#ffffff" align="center">
              <input type="radio" name="payment_id" value="<?php echo $this->_var['list']['pay_id']; ?>" /><?php echo $this->_var['list']['pay_name']; ?></td>
              <td bgcolor="#ffffff" align="left"><?php echo $this->_var['list']['pay_desc']; ?></td>
              <td bgcolor="#ffffff" align="center"><?php echo $this->_var['list']['pay_fee']; ?></td>
            </tr>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
            <tr>
        <td bgcolor="#ffffff" colspan="3"  align="center">
        <input type="hidden" name="surplus_type" value="0" />
          <input type="hidden" name="rec_id" value="<?php echo $this->_var['order']['id']; ?>" />
          <input type="hidden" name="act" value="act_account" />
          <input type="submit" class="button_1" name="submit" value="提交" />
          <input type="reset" class="button_1" name="reset" value="重置" />
        </td>
      </tr>
          </table>
        </form>
        <?php endif; ?>
        <?php if ($this->_var['action'] == "act_account"): ?>
        <div id="title_list"> <span class="title ">充值付款 </span><span class="logo"></span></div>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dddddd" class="user_account">
          <tr>
            <td width="25%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['surplus_amount']; ?></td>
            <td width="80%" bgcolor="#ffffff"><?php echo $this->_var['amount']; ?></td>
          </tr>
          <tr>
            <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment_name']; ?></td>
            <td bgcolor="#ffffff"><?php echo $this->_var['payment']['pay_name']; ?></td>
          </tr>
          <tr>
            <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment_fee']; ?></td>
            <td bgcolor="#ffffff"><?php echo $this->_var['pay_fee']; ?></td>
          </tr>
          <tr>
            <td align="right" valign="middle" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment_desc']; ?></td>
            <td bgcolor="#ffffff"><?php echo $this->_var['payment']['pay_desc']; ?></td>
          </tr>
          <tr>
            <td align="center" colspan="2" bgcolor="#ffffff"><?php echo $this->_var['payment']['pay_button']; ?></td>
          </tr>
        </table>
        <?php endif; ?>
       <?php if ($this->_var['action'] == "account_detail"): ?>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class='user_account'>
          <tr align="center">
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['process_time']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['money']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['change_desc']; ?></th>
          </tr>
          <?php $_from = $this->_var['account_log']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['item']):
?>
          <tr>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['change_time']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['amount']; ?></td>
            <td align="center" bgcolor="#ffffff" title="<?php echo $this->_var['item']['change_desc']; ?>">&nbsp;&nbsp;<?php echo $this->_var['item']['short_change_desc']; ?></td>
          </tr>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
          <tr>
            <td colspan="4" align="right" bgcolor="#f2f2f2"><?php echo $this->_var['lang']['current_surplus']; ?><?php echo $this->_var['surplus_amount']; ?> 　</td>
          </tr>
        </table>
        <?php echo $this->fetch('library/pages.lbi'); ?>
        <?php endif; ?>
        <?php if ($this->_var['action'] == "account_log"): ?>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class='user_account'>
          <tr align="center">
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['process_time']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['surplus_pro_type']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['money']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['process_notic']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['admin_notic']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['is_paid']; ?></th>
            <th bgcolor="#ffffff"><?php echo $this->_var['lang']['handle']; ?></th>
          </tr>
          <?php $_from = $this->_var['account_log']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['item']):
?>
          <tr>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['add_time']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['type']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['amount']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['short_user_note']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['short_admin_note']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['pay_status']; ?></td>
            <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['handle']; ?>
              <?php if (( $this->_var['item']['is_paid'] == 0 && $this->_var['item']['process_type'] == 1 ) || $this->_var['item']['handle']): ?>
              <a href="user.php?act=cancel&id=<?php echo $this->_var['item']['id']; ?>" onclick="if (!confirm('<?php echo $this->_var['lang']['confirm_remove_account']; ?>')) return false;"><?php echo $this->_var['lang']['is_cancel']; ?></a>
              <?php endif; ?>
            </td>
          </tr>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
          <tr>
            <td colspan="7" align="right" bgcolor="#ffffff" style="color: #d10842">可用资金:<?php echo $this->_var['surplus_amount']; ?>　</td>
          </tr>
        </table>
        <?php echo $this->fetch('library/pages.lbi'); ?>
      <?php endif; ?>
      



      
      <?php if ($this->_var['action'] == 'address_list'): ?>
         
            <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js,transport.js,region.js,shopping_flow.js')); ?>
            <script type="text/javascript">
              region.isAdmin = false;
              <?php $_from = $this->_var['lang']['flow_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
              var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
              <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
              
              onload = function() {
                if (!document.all)
                {
                  document.forms['theForm'].reset();
                }
              }
              
            </script>
        <?php if ($this->_var['count'] < 20): ?>
        <div class="user_addrs addr">
        <div id="title_list"> <span class="title ">新增收货地址 </span></div>
        <form action="user.php" method="post" name="theForm" onsubmit="return checkConsignee(this)">
          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="user_addr">
            <tbody>
            <tr>
              <td align="right" bgcolor="#ffffff" width="120"><span class="red">*</span> 收货人姓名：　</td>
              <td bgcolor="#ffffff"><input name="consignee" type="text" class="input_border" id="consignee_2" size="20" value=""></td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff"><span class="red">*</span> 配送区域：　</td>
              <td colspan="3" align="left" bgcolor="#ffffff">
                <div class="none">
                <span class="select_ui none">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;">请选择</div>
                  <select name="country" id="selCountries" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 1, 'selProvinces')">
                    <option value="1" selected>中国</option>
                  </select>
                </span>
                </div>
                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;">请选择省</div>
                  <select name="province" id="selProvinces" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 2, 'selCities')">
                    <option value="0" selected>请选择省</option>
                    <?php $_from = $this->_var['province_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'province');if (count($_from)):
    foreach ($_from AS $this->_var['province']):
?>
                    <option value="<?php echo $this->_var['province']['region_id']; ?>" ><?php echo $this->_var['province']['region_name']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                  </select>
                </span>

                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;">请选择市</div>
                  <select name="city" id="selCities" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 3, 'selDistricts')">
                    <option value="0">请选择市</option>
                  </select>
                </span>

                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;">请选择区</div>
                  <select name="district" id="selDistricts" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());">
                    <option value="0">请选择区</option>
                  </select>
                </span>
              </td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff"><span class="red">*</span> 详细地址：　</td>
              <td bgcolor="#ffffff"><input name="address" type="text" class="input_border" size="60" id="address_2" value="">
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff"><span class="red">*</span> 手机：　</td>
              <td bgcolor="#ffffff"><input name="mobile" type="text" class="input_border" id="mobile_2" value="" size="25"></td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff">电话：　</td>
              <td bgcolor="#ffffff"><input name="tel" type="text" class="input_border" id="tel_2" value=""></td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff">&nbsp;</td>
              <td colspan="1" align="left" bgcolor="#ffffff">                
                <input type="submit" name="submit" class="button_1" value="保存收货地址">
                <input type="hidden" name="act" value="act_edit_address">
                <input name="address_id" type="hidden" value="">
              </td>
            </tr>
          </tbody></table>
        </form>
        </div>
        <?php endif; ?>
        <?php $_from = $this->_var['consignee_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('sn', 'consignee');if (count($_from)):
    foreach ($_from AS $this->_var['sn'] => $this->_var['consignee']):
?>
        <div class="user_addr_<?php echo $this->_var['sn']; ?> addr none">
        <div id="title_list"> <span class="title ">修改收货地址 </span></div>
        <form action="user.php" method="post" name="theForm" onsubmit="return checkConsignee(this)">
          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="user_addr">
            <tbody>
            <tr>
              <td align="right" bgcolor="#ffffff" width="120"><span class="red">*</span> 收货人姓名：　</td>
              <td bgcolor="#ffffff"><input name="consignee" type="text" class="input_border" id="consignee_2" value="<?php echo htmlspecialchars($this->_var['consignee']['consignee']); ?>" size="20"></td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff"><span class="red">*</span> 配送区域：　</td>
              <td colspan="3" align="left" bgcolor="#ffffff">
                <div class="none">
                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;">中国</div>
                  <select name="country" id="selCountries_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 1, 'selProvinces_<?php echo $this->_var['sn']; ?>');">
                    <?php $_from = $this->_var['country_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'country');if (count($_from)):
    foreach ($_from AS $this->_var['country']):
?>
                    <option value="<?php echo $this->_var['country']['region_id']; ?>" <?php if ($this->_var['consignee']['country'] == $this->_var['country']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['country']['region_name']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                  </select>
                </span>
                </div>
                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;"><?php echo $this->_var['p_list'][$this->_var['sn']]; ?></div>
                  <select name="province" id="selProvinces_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 2, 'selCities_<?php echo $this->_var['sn']; ?>');">
                    <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['1']; ?></option>
                    <?php $_from = $this->_var['province_lists'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'province');if (count($_from)):
    foreach ($_from AS $this->_var['province']):
?>
                    <option value="<?php echo $this->_var['province']['region_id']; ?>" <?php if ($this->_var['consignee']['province'] == $this->_var['province']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['province']['region_name']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                  </select>
                </span>
                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;"><?php echo $this->_var['c_list'][$this->_var['sn']]; ?></div>
                  <select name="city" id="selCities_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());region.changed(this, 3, 'selDistricts_<?php echo $this->_var['sn']; ?>');">
                    <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['2']; ?></option>
                    <?php $_from = $this->_var['city_lists'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'city');if (count($_from)):
    foreach ($_from AS $this->_var['city']):
?>
                    <option value="<?php echo $this->_var['city']['region_id']; ?>" <?php if ($this->_var['consignee']['city'] == $this->_var['city']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['city']['region_name']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                  </select>
                </span>

                <span class="select_ui">
                  <div class="select_arrow"></div>
                  <div class="select_text_ui" style="min-width: 2.5em;"><?php echo $this->_var['d_list'][$this->_var['sn']]; ?></div>
                  <select name="district" id="selDistricts_<?php echo $this->_var['sn']; ?>" onchange="$(this).parent().find('.select_text_ui').html($(this).find('option:selected').text());">
                    <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['3']; ?></option>
                    <?php $_from = $this->_var['district_lists'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'district');if (count($_from)):
    foreach ($_from AS $this->_var['district']):
?>
                    <option value="<?php echo $this->_var['district']['region_id']; ?>" <?php if ($this->_var['consignee']['district'] == $this->_var['district']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['district']['region_name']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                  </select>
                </span>
              </td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff"><span class="red">*</span> 详细地址：　</td>
              <td bgcolor="#ffffff"><input name="address" type="text" class="input_border" size="60" id="address_2" value="<?php echo htmlspecialchars($this->_var['consignee']['address']); ?>">
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff"><span class="red">*</span> 手机：　</td>
              <td bgcolor="#ffffff"><input name="mobile" type="text" class="input_border" id="mobile_2" value="<?php echo htmlspecialchars($this->_var['consignee']['mobile']); ?>" size="25"></td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff">电话：　</td>
              <td bgcolor="#ffffff"><input name="tel" type="text" class="input_border" id="tel_2" value="<?php echo htmlspecialchars($this->_var['consignee']['tel']); ?>" size="18"></td>
            </tr>
            <tr>
              <td align="right" bgcolor="#ffffff">&nbsp;</td>
              <td colspan="1" align="left" bgcolor="#ffffff">
                <input type="submit" name="submit" class="button_1" value="保存收货地址">
                <input type="hidden" name="act" value="act_edit_address">
                <input name="address_id" type="hidden" value="<?php echo $this->_var['consignee']['address_id']; ?>" />
                <a onclick="$('.addr').hide();$('.user_addrs').show();">取消</a>
              </td>
            </tr>
          </tbody></table>
        </form>
        </div>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        <div>
          <table>
            <tr style="height: 42px;">
            </tr>
          </table>
        </div>
        <div id="title_list"> <span class="title ">已保存的地址 </span></div>
         <?php if ($this->_var['count'] >= 20): ?>   <div class="notice_content">最多保存20个有效地址。</div> <?php endif; ?>
              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="user_addr_now">
                <tr class="list">
                  <th width="1%"></th>
                  <th>收货人</th>
                  <th>收货地址</th>
                  <th>手机</th>
                  <th width='100'>固定电话</th>
                  <th width='100'>操作</th>
                  <th width="1%"></th>
                </tr>
              <?php $_from = $this->_var['consignee_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('sn', 'consignee');if (count($_from)):
    foreach ($_from AS $this->_var['sn'] => $this->_var['consignee']):
?>
                <tr class="saved" align="center">
                  <td width="1%"></td>
                  <td <?php if ($this->_var['sn'] != 0): ?> class="borders" <?php endif; ?>> <?php echo htmlspecialchars($this->_var['consignee']['consignee']); ?></td>
                  <td <?php if ($this->_var['sn'] != 0): ?> class="borders" <?php endif; ?>><?php echo $this->_var['p_list'][$this->_var['sn']]; ?>-<?php echo $this->_var['c_list'][$this->_var['sn']]; ?>-<?php echo $this->_var['d_list'][$this->_var['sn']]; ?>-<?php echo htmlspecialchars($this->_var['consignee']['address']); ?></td>
                  <td <?php if ($this->_var['sn'] != 0): ?> class="borders" <?php endif; ?>><?php echo htmlspecialchars($this->_var['consignee']['mobile']); ?></td>
                  <td <?php if ($this->_var['sn'] != 0): ?> class="borders" <?php endif; ?>><?php echo htmlspecialchars($this->_var['consignee']['tel']); ?></td>
                  <td <?php if ($this->_var['sn'] != 0): ?> class="borders" <?php endif; ?>>
                    <a onclick="$('.addr').hide();$('.user_addr_<?php echo $this->_var['sn']; ?>').show();$('body,html').animate({scrollTop:280},300);">修改</a>
                    <a onclick="if (confirm('<?php echo $this->_var['lang']['confirm_drop_address']; ?>'))location.href='user.php?act=drop_consignee&id=<?php echo $this->_var['consignee']['address_id']; ?>'">删除</a>
                  </td>
                  <td width="1%"></td>
                </tr>
              <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
              </table>
      <?php endif; ?>
    
    
    
         <?php if ($this->_var['action'] == 'my_recommend'): ?>
        <style>
        	#user .user_recommend{float: left;margin-top: 12px;padding: 15px 0;width: 818px;}
        	#user .user_recommend td{background: #fff none repeat scroll 0 0;color: #7e7878;font-weight: normal;height: 35px;line-height: 20px;}
			#user .user_recommend .input_border {background: #fff none repeat scroll 0 0;border: 1px solid #ccc;border-radius: 2px;box-shadow: 0 1px 2px 0 #f0f0f0 inset;font-size: 12px;height: 1.5em;line-height: 1.5;outline: 0 none;padding: 5px;}
        </style>
      <div id="title_list"> <span class="title ">我的推荐人</span></div>
     <form name="formbindingrecommend" action="user.php" method="post" onSubmit="return bindingrecommend()" >
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="user_recommend" >
        <tr>
          
         <?php if ($this->_var['user']['agent_rank'] == 100): ?>
          <td width="12%" align="right" bgcolor="#FFFFFF">推荐人手机号：</td>
          <td width="76%" align="left" bgcolor="#FFFFFF"><input name="recommend_mobile" type="text" size="25" id="bindingrecommend_mobile" class="input_border" /></td>
        <?php elseif ($this->_var['user']['agent_rank'] == 1): ?>
        <td width="12%" align="right" bgcolor="#FFFFFF"></td>
          <td width="76%" align="left" bgcolor="#FFFFFF">我是分销商</td>
        <?php elseif ($this->_var['user']['agent_rank'] == 2): ?>
        <td width="12%" align="right" bgcolor="#FFFFFF">分销商手机：</td>
          <td width="76%" align="left" bgcolor="#FFFFFF"><?php echo $this->_var['one_user']['mobile_phone']; ?></td>
        <?php endif; ?>
        </tr>
        <tr>
          <td></td>
          <td colspan="1" align="left" bgcolor="#FFFFFF">
          	<input name="act" type="hidden" value="my_recommend_action" />
          	<?php if ($this->_var['user']['agent_rank'] == 100): ?>
          	<input name="submit" type="submit" class="button_1" value="绑定" />
          	<?php endif; ?>
            
          </td>
        </tr>
      </table>
    </form>
    <div>
      <table>
         <tr style="height: 42px;">
         </tr>
      </table>
    </div>
    <?php endif; ?>
    
    
    
    <?php if ($this->_var['action'] == 'my_distributor'): ?>
    <div id="title_list"> <span class="title ">我的分销商<?php if (! empty ( $this->_var['user_array']['withdraw_account'] )): ?>&nbsp;&nbsp;-&nbsp;&nbsp;提现账号：<?php echo $this->_var['user_array']['withdraw_account']; ?><?php endif; ?></span></div>
    <table width="818px" border="0" cellpadding="0" cellspacing="10"  class="order_msg" >
          <tr class="list">
            <th width="2%"></th>
            <th width="13%">用户名</th>
            <th width="18%">绑定手机号</th>
            <th width="16%">成为分销商时间</th>
            <th width="20%">总消费额</th>
            <th width="2%"></th>
          </tr>
      <?php $_from = $this->_var['user_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
      <tr align="center">
        <td></td>
        <td class="sum1" width="13%" valign='center'><?php echo $this->_var['item']['user_name']; ?></td>
        <td class="border" width="18%" valign='center'><?php echo $this->_var['item']['mobile_phone']; ?></td>
        <td class="border" width="13%" valign='center'><?php echo $this->_var['item']['agent2_time']; ?></td>
        <td class="border" width="15%" valign='center'><?php echo $this->_var['item']['all_price']; ?><br /></td>
        <td></td>
      </tr>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
      </table>
    <?php endif; ?>
    
    
    
    
    <?php if ($this->_var['action'] == 'distributor_detailed'): ?>
    <form action="user.php?act=distributor_detailed" method="post">
    	时间筛选：
	    <select name="time_select" >
	    	<option value="0" <?php if ($this->_var['time_select'] == 0): ?>selected<?php endif; ?> >全部</option>
	    	<option value="1" <?php if ($this->_var['time_select'] == 1): ?>selected<?php endif; ?>>本月</option>
	    	<option value="2" <?php if ($this->_var['time_select'] == 2): ?>selected<?php endif; ?>>上个月</option>
	    </select>
	    <button type="submit">提交</button>
    </form>
    <form action="user.php?act=user_withdraw" method="post">
	    <button style="float: right;" type="submit">申请提现</button>
    </form>
    <div id="title_list"> <span class="title ">分销明细</span></div>
    <table width="818px" border="0" cellpadding="0" cellspacing="10"  class="order_msg" >
          <tr class="list">
            <th width="2%"></th>
            <th width="15%">订单编号</th>
            <th width="13%">用户名</th>
            <th width="13%">用户手机</th>
            <th width="20%">购买时间</th>
            <th width="15%">商品金额</th>
            <th width="10%">提成金额</th>
            <th width="10%">提现状态</th>
            <th width="2%"></th>
          </tr>
      <?php $_from = $this->_var['order_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
      <tr align="center">
        <td></td>
        <td class="sum1" width="13%" valign='center'><?php echo $this->_var['item']['order_sn']; ?></td>
        <td class="border" valign='center'><?php echo $this->_var['item']['user_name']; ?></td>
        <td class="border" valign='center'><?php echo $this->_var['item']['mobile_phone']; ?></td>
        <td class="border" valign='center'><?php echo $this->_var['item']['add_time']; ?><br /></td>
        <td class="border" valign='center'><?php echo $this->_var['item']['goods_amount']; ?><br /></td>
        <td class="border" valign='center'><?php echo $this->_var['item']['commission_price']; ?><br /></td>
        <td class="border" valign='center'><?php echo $this->_var['item']['withdraw_status']; ?><br /></td>
        <td></td>
      </tr>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
      </table>
    <?php endif; ?>
    
    
    
      
       <?php if ($this->_var['action'] == 'transform_points'): ?>
        <div class="top"><b><?php echo $this->_var['lang']['transform_points']; ?></b></div>
       <span><?php echo $this->_var['lang']['transform_points']; ?></span>
             <div class="blank"></div>
       <?php if ($this->_var['exchange_type'] == 'ucenter'): ?>
        <form action="user.php" method="post" name="transForm" onsubmit="return calcredit();">
       <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
                <tr>
                    <th width="120" bgcolor="#FFFFFF" align="right" valign="top"><?php echo $this->_var['lang']['cur_points']; ?>:</th>
                    <td bgcolor="#FFFFFF">
                    <label for="pay_points"><?php echo $this->_var['lang']['exchange_points']['1']; ?>:</label><input type="text" size="15" id="pay_points" name="pay_points" value="<?php echo $this->_var['shop_points']['pay_points']; ?>" style="border:0;border-bottom:1px solid #DADADA;" readonly="readonly" /><br />
                    <div class="blank"></div>
                    <label for="rank_points"><?php echo $this->_var['lang']['exchange_points']['0']; ?>:</label><input type="text" size="15" id="rank_points" name="rank_points" value="<?php echo $this->_var['shop_points']['rank_points']; ?>" style="border:0;border-bottom:1px solid #DADADA;" readonly="readonly" />
                    </td>
                    </tr>
          <tr><td bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr>
            <th align="right" bgcolor="#FFFFFF"><label for="amount"><?php echo $this->_var['lang']['exchange_amount']; ?>:</label></th>
            <td bgcolor="#FFFFFF"><input size="15" name="amount" id="amount" value="0" onkeyup="calcredit();" type="text" />
                <select name="fromcredits" id="fromcredits" onchange="calcredit();">
                  <?php echo $this->html_options(array('options'=>$this->_var['lang']['exchange_points'],'selected'=>$this->_var['selected_org'])); ?>
                </select>
            </td>
          </tr>
          <tr>
            <th align="right" bgcolor="#FFFFFF"><label for="desamount"><?php echo $this->_var['lang']['exchange_desamount']; ?>:</label></th>
            <td bgcolor="#FFFFFF"><input type="text" name="desamount" id="desamount" disabled="disabled" value="0" size="15" />
              <select name="tocredits" id="tocredits" onchange="calcredit();">
                <?php echo $this->html_options(array('options'=>$this->_var['to_credits_options'],'selected'=>$this->_var['selected_dst'])); ?>
              </select>
            </td>
          </tr>
          <tr>
            <th align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['exchange_ratio']; ?>:</th>
            <td bgcolor="#FFFFFF">1 <span id="orgcreditunit"><?php echo $this->_var['orgcreditunit']; ?></span> <span id="orgcredittitle"><?php echo $this->_var['orgcredittitle']; ?></span> <?php echo $this->_var['lang']['exchange_action']; ?> <span id="descreditamount"><?php echo $this->_var['descreditamount']; ?></span> <span id="descreditunit"><?php echo $this->_var['descreditunit']; ?></span> <span id="descredittitle"><?php echo $this->_var['descredittitle']; ?></span></td>
          </tr>
          <tr><td bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF"><input type="hidden" name="act" value="act_transform_ucenter_points" /><input type="submit" name="transfrom" value="<?php echo $this->_var['lang']['transform']; ?>" /></td></tr>
  </table>
        </form>
       <script type="text/javascript">
        <?php $_from = $this->_var['lang']['exchange_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'lang_js');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['lang_js']):
?>
        var <?php echo $this->_var['key']; ?> = '<?php echo $this->_var['lang_js']; ?>';
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>

        var out_exchange_allow = new Array();
        <?php $_from = $this->_var['out_exchange_allow']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'ratio');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['ratio']):
?>
        out_exchange_allow['<?php echo $this->_var['key']; ?>'] = '<?php echo $this->_var['ratio']; ?>';
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>

        function calcredit()
        {
            var frm = document.forms['transForm'];
            var src_credit = frm.fromcredits.value;
            var dest_credit = frm.tocredits.value;
            var in_credit = frm.amount.value;
            var org_title = frm.fromcredits[frm.fromcredits.selectedIndex].innerHTML;
            var dst_title = frm.tocredits[frm.tocredits.selectedIndex].innerHTML;
            var radio = 0;
            var shop_points = ['rank_points', 'pay_points'];
            if (parseFloat(in_credit) > parseFloat(document.getElementById(shop_points[src_credit]).value))
            {
                alert(balance.replace('{%s}', org_title));
                frm.amount.value = frm.desamount.value = 0;
                return false;
            }
            if (typeof(out_exchange_allow[dest_credit+'|'+src_credit]) == 'string')
            {
                radio = (1 / parseFloat(out_exchange_allow[dest_credit+'|'+src_credit])).toFixed(2);
            }
            document.getElementById('orgcredittitle').innerHTML = org_title;
            document.getElementById('descreditamount').innerHTML = radio;
            document.getElementById('descredittitle').innerHTML = dst_title;
            if (in_credit > 0)
            {
                if (typeof(out_exchange_allow[dest_credit+'|'+src_credit]) == 'string')
                {
                    frm.desamount.value = Math.floor(parseFloat(in_credit) / parseFloat(out_exchange_allow[dest_credit+'|'+src_credit]));
                    frm.transfrom.disabled = false;
                    return true;
                }
                else
                {
                    frm.desamount.value = deny;
                    frm.transfrom.disabled = true;
                    return false;
                }
            }
            else
            {
                return false;
            }
        }
       </script>
       <?php else: ?>
        <b><?php echo $this->_var['lang']['cur_points']; ?>:</b>
        <table width="100%" border="0" cellpadding="5" cellspacing="1">
          <tr>
            <td width="30%" valign="top" bgcolor="#FFFFFF"><table border="0">
              <?php $_from = $this->_var['bbs_points']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'points');if (count($_from)):
    foreach ($_from AS $this->_var['points']):
?>
              <tr>
                <th><?php echo $this->_var['points']['title']; ?>:</th>
                <td width="120" style="border-bottom:1px solid #DADADA;"><?php echo $this->_var['points']['value']; ?></td>
              </tr>
              <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
            </table></td>
            <td width="50%" valign="top" bgcolor="#FFFFFF"><table>
                    <tr>
                <th><?php echo $this->_var['lang']['pay_points']; ?>:</th>
                <td width="120" style="border-bottom:1px solid #DADADA;"><?php echo $this->_var['shop_points']['pay_points']; ?></td>
                    </tr>
              <tr>
                <th><?php echo $this->_var['lang']['rank_points']; ?>:</th>
                <td width="120" style="border-bottom:1px solid #DADADA;"><?php echo $this->_var['shop_points']['rank_points']; ?></td>
              </tr>
            </table></td>
          </tr>
        </table>
        <br />
        <b><?php echo $this->_var['lang']['rule_list']; ?>:</b>
        <ul class="point clearfix">
          <?php $_from = $this->_var['rule_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'rule');if (count($_from)):
    foreach ($_from AS $this->_var['rule']):
?>
          <li><font class="f1">·</font>"<?php echo $this->_var['rule']['from']; ?>" <?php echo $this->_var['lang']['transform']; ?> "<?php echo $this->_var['rule']['to']; ?>" <?php echo $this->_var['lang']['rate_is']; ?> <?php echo $this->_var['rule']['rate']; ?>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </ul>

        <form action="user.php" method="post" name="theForm">
        <table width="100%" border="1" align="center" cellpadding="5" cellspacing="0" style="border-collapse:collapse;border:1px solid #DADADA;">
          <tr style="background:#F1F1F1;">
            <th><?php echo $this->_var['lang']['rule']; ?></th>
            <th><?php echo $this->_var['lang']['transform_num']; ?></th>
            <th><?php echo $this->_var['lang']['transform_result']; ?></th>
          </tr>
          <tr>
            <td>
              <select name="rule_index" onchange="changeRule()">
                <?php $_from = $this->_var['rule_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'rule');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['rule']):
?>
                <option value="<?php echo $this->_var['key']; ?>"><?php echo $this->_var['rule']['from']; ?>-><?php echo $this->_var['rule']['to']; ?></option>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
              </select>
          </td>
          <td>
            <input type="text" name="num" value="0" onkeyup="calPoints()"/>
          </td>
          <td><span id="ECS_RESULT">0</span></td>
          </tr>
          <tr>
            <td colspan="3" align="center"><input type="hidden" name="act" value="act_transform_points"  /><input type="submit" value="<?php echo $this->_var['lang']['transform']; ?>" /></td>
          </tr>
        </table>
        </form>
       <script type="text/javascript">
          //<![CDATA[
            var rule_list = new Object();
            var invalid_input = '<?php echo $this->_var['lang']['invalid_input']; ?>';
            <?php $_from = $this->_var['rule_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'rule');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['rule']):
?>
            rule_list['<?php echo $this->_var['key']; ?>'] = '<?php echo $this->_var['rule']['rate']; ?>';
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
            function calPoints()
            {
              var frm = document.forms['theForm'];
              var rule_index = frm.elements['rule_index'].value;
              var num = parseInt(frm.elements['num'].value);
              var rate = rule_list[rule_index];

              if (isNaN(num) || num < 0 || num != frm.elements['num'].value)
              {
                document.getElementById('ECS_RESULT').innerHTML = invalid_input;
                rerutn;
              }
              var arr = rate.split(':');
              var from = parseInt(arr[0]);
              var to = parseInt(arr[1]);

              if (from <=0 || to <=0)
              {
                from = 1;
                to = 0;
              }
              document.getElementById('ECS_RESULT').innerHTML = parseInt(num * to / from);
            }

            function changeRule()
            {
              document.forms['theForm'].elements['num'].value = 0;
              document.getElementById('ECS_RESULT').innerHTML = 0;
            }
          //]]>
       </script>
       <?php endif; ?>
        <?php endif; ?>
        
  </div>
  
</div>
</div>
<div class="hr5"></div>
<?php echo $this->fetch('common/page_footer.lbi'); ?>
<?php echo $this->fetch('common/follow_right.lbi'); ?>
</body>
<script type="text/javascript">
<?php $_from = $this->_var['lang']['clips_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</script>
</html>
